1. Field
The present disclosure relates to managing data and in particular to managing data packets received at a network adapter. Still more particularly, the present disclosure relates to a method and apparatus for managing data packets received in a direct memory access memory for a network adapter.
2. Description of the Related Art
In a network, computers send and receive data in the form of data packets. The data packets are commonly received using a network adapter. A network adapter is a hardware device that allows computers to communicate over a network. In a network adapter, data packets received are stored in buffers. A buffer is a portion of memory used to temporarily hold data while the data is being moved from one place to another.
Generally speaking, a processor unit in a computer stores data in a memory. The data may be stored in buffers in the memory. However, using the processor unit to store data packets received in a buffer may increase a number of operations performed by the processor unit. The total number of operations performed by a processor unit is generally referred to as processor overhead. This increase in the processor overhead may decrease the performance of the processor unit. For example, the processor unit may not be able to process as many instructions while storing data packets received.
To reduce the overhead of the processor unit, devices that receive data packets may have portions of memory allocated to the device. A device that has memory allocated to the device can store data in that memory independently of the processor unit. This memory allocation to the device reduces the overhead or number of operations to be performed by the processor unit. For example, a network adapter can store data packets received in a buffer without the data packet being written to the buffer by the processor unit. The allocation of memory to a device is generally referred to as direct memory access (DMA). In other words, the device has “direct” or independent-of-the-processor memory access.
However, the amount of memory allocated to the device may be limited. For example, certain devices may have memory within the devices. In other examples, a portion of a memory may be shared among multiple devices. In either situation, the amount of memory that may be allocated to one device has limits.
For example, in a network, a network adapter may receive multiple data packets for a certain period of time. The network adapter may receive data packets faster than the data packets are processed. In this situation, demand for storage at the network adapter may exceed a capacity of the memory allocated to the network adapter. When the capacity is exceeded, data packets may be dropped by the network adapter or not stored in the memory. When data packets are dropped, the network adapter that dropped the data packets may have to request retransmission of the data packet. Retransmission of the data packets increases an amount of traffic in a network and may decrease the speed of connections in the network.
Accordingly, it would be advantageous to have a method and apparatus which takes into account one or more of the issues discussed above as well as possibly other issues.